<template>
  <div>
    长度：
    <el-input style="width:20%;" size="mini" type="number" step="1" :min="1" v-model="strlen"/>
    <el-button size="mini" type="primary" @click="str = randomString(strlen)">生成</el-button>
    <el-input
      type="textarea"
      :autosize="{ minRows: 1, maxRows: 2 }"
      v-model="str"
      readonly
    >
    </el-input>
  </div>
</template>
<script>
import { randomString } from '../../utils'
export default {
  name: 'StrGen',
  data() {
    return {
      strlen: 16,
      str: '',
    }
  },
  methods: {
    randomString: randomString
  }
}
</script>